package hs.framework.opcClient.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Description TODO
 * @Author sxmz
 * @Date 2021/5/17 0017 上午 11:17
 */
@Data
@TableName("api_log")
@ToString(callSuper = true)
@ApiModel(value = "ApiLog对象", description = "接口日志表，用于记录接口日志信息")
public class ApiLog implements Serializable {
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * ip地址
     */
    @ApiModelProperty(value = "ip地址")
    @JsonSerialize(using = NullSerializer.class)
    private String ipAddress;

    /**
     * 请求接口
     */
    @ApiModelProperty(value = "请求接口")
    @JsonSerialize(using = NullSerializer.class)
    private String url;
    /**
     * 请求类
     */
    @ApiModelProperty(value = "请求类")
    @JsonSerialize(using = NullSerializer.class)
    private String className;
    /**
     * 方法名
     */
    @ApiModelProperty(value = "方法名")
    @JsonSerialize(using = NullSerializer.class)
    private String methodName;
    /**
     * 请求参数
     */
    @ApiModelProperty(value = "请求参数")
    @JsonSerialize(using = NullSerializer.class)
    private String params;
    /**
     * 类路径
     */
    @ApiModelProperty(value = "返回值")
    @JsonSerialize(using = NullSerializer.class)
    private String result;
    /**
     * 请求接收时间
     */
    @ApiModelProperty(value = "请求接收时间")
    @JsonSerialize(using = NullSerializer.class)
    private LocalDateTime acceptTime;
    /**
     * 请求类型
     */
    @ApiModelProperty(value = "请求类型")
    @JsonSerialize(using = NullSerializer.class)
    private String requestType;
    /**
     * 处理时间
     */
    @ApiModelProperty(value = "处理时间 单位：ms")
    @JsonSerialize(using = NullSerializer.class)
    private Long processTime;

}
